home *** CD-ROM | disk | FTP | other *** search
/ PC-Blue - MS DOS Public Domain Library / PC-Blue MS-DOS Public Domain Library - NYACC.iso / vol039 / quest.bas (.txt) < prev    next >
Encoding:
GW-BASIC  |  1987-01-11  |  13.1 KB  |  202 lines

  1. 10  '         ***************************************************
  2. 20  '         *     History Data entry and Changing Program     *
  3. 30  '         *    To be used with History time warp Program    *
  4. 40  '         *   Basic Programming final written by M.P. Kay   *
  5. 50  '         ***************************************************
  6. 60  '
  7. 70  KEY OFF:FOR I=1 TO 10:KEY I,"":NEXT:ON ERROR GOTO 1480
  8. 80  DIM M$(14),M1$(14),M2$(14):SP$=STRING$(79,32)
  9. 90  R(1)=8:C(1)=20:F$(1)=STRING$(4,58):R(2)=11:C(2)=1:F$(2)=STRING$(78,58):R(3)=12:C(3)=72:F$(3)=":":R(4)=14:C(4)=19:F$(4)=STRING$(20,58):R(5)=15:C(5)=19:F$(5)=F$(4):R(6)=16:C(6)=19:F$(6)=F$(4):R(7)=17:C(7)=19:F$(7)=F$(4)
  10. 100  R(8)=19:C(8)=10:F$(8)=STRING$(20,58):R(9)=22:C(9)=1:F$(9)=STRING$(78,58)
  11. 110  ' ------------------- Menu requesting Instructions -------------------------
  12. 120  CLS:LOCATE 10,20:PRINT "This Program is for Generating New Questions":PRINT
  13. 130  LOCATE 12,30:PRINT "Do you need instructions ";
  14. 140  LOCATE 25,22:PRINT "Press ";:COLOR 15:PRINT "Esc";:COLOR 7:PRINT " to return to History Program  ";
  15. 150  LE=1:GOSUB 1390:IF Y=27 THEN RUN "HISTORY"
  16. 160  IF Y$="Y" OR Y$="y" THEN 1560
  17. 170  IF Y$="N" OR Y$="n" THEN 190 ELSE 150
  18. 180  ' -------------------------- Get Menu Data -----------------------------
  19. 190  OPEN "MENU.DAT" FOR INPUT AS #1
  20. 200  FOR I=1 TO 14
  21. 210  LINE INPUT #1,M$(I):LINE INPUT #1,M1$(I):LINE INPUT #1,M2$(I)
  22. 220  NEXT I:CLOSE
  23. 230  ' ---------------- Print Menu Sreen for Changes ------------------------
  24. 240  CLS:FOR I=1 TO 7:PRINT USING "        # - \\\                          \      ## - \\\                       \";I,M$(I),M1$(I),I+7,M$(I+7),M1$(I+7):NEXT I
  25. 250  LOCATE 15,13:PRINT "To change the menu Type the ";:COLOR 15:PRINT "#";:COLOR 7:PRINT ". Press ";:COLOR 15:PRINT "Esc ";:COLOR 7:PRINT "Prev. Screen. ":PRINT STRING$(79,196)
  26. 260  LOCATE 25,1:PRINT SP$;
  27. 270  LOCATE 15,68:LE=2:GOSUB 1390:A=VAL(A$):IF Y=27 THEN 120
  28. 280  IF A=7 OR A>12 THEN BEEP:LOCATE 25,25:PRINT "You cannot change Numbers 7 - 13 -14";:FOR T=1 TO 2000:NEXT T:GOTO 260
  29. 290  IF A<1 OR A>12 THEN 260
  30. 300  ' --------------------- Change Menu Variables --------------------------
  31. 310  LOCATE 25,9:COLOR 15:PRINT "Esc";:COLOR 7:PRINT " takes you back to Previous Entry        ";:COLOR 15:PRINT "End";:COLOR 7:PRINT " if no changes";:NN=A
  32. 320  LOCATE 17,17:COLOR 15:PRINT "You Elected to change this Period and message":COLOR 7
  33. 330  LOCATE 19,1:PRINT M$(A);M1$(A);TAB(33)"::::::::::::::::::::::::::::"
  34. 340  LOCATE 21,1:PRINT M2$(A):LOCATE 22,1:PRINT STRING$(66,58)
  35. 350  Z=0:LOCATE 19,33:PRINT ":":LOCATE 19,33:LE=1:GOSUB 1390:IF Y=27 THEN GOSUB 1370:LOCATE 15,68:PRINT "  ";:GOTO 260
  36. 360  IF Z=79 THEN 590
  37. 370  IF LEN(A$)<1 THEN ST=1:GOSUB 1530:GOTO 350
  38. 380  IF A$ <"A" OR A$ > "Z" THEN LOCATE 25,1:PRINT SP$;:LOCATE 25,20:PRINT "This MUST be a capital letter";:BEEP:GOTO 350
  39. 390  FOR J=1 TO 14:IF A$ = M$(J) AND J<>NN THEN LOCATE 25,1:PRINT SP$;:LOCATE 25,18:PRINT "First letters of a Subject CANNOT match another";:BEEP:GOTO 350
  40. 400  NEXT J
  41. 410  X$=A$
  42. 420  LOCATE 19,34:PRINT STRING$(28,58):LOCATE 19,34:LE=28:GOSUB 1390:IF Y=27 THEN 330 ELSE IF Y=79 THEN 590
  43. 430  IF LEN(A$)<5 THEN ST=5:GOSUB 1530:GOTO 420
  44. 440  X1$=A$
  45. 450  LOCATE 22,1:PRINT STRING$(66,58):LOCATE 22,1:LE=66:GOSUB 1390:IF Y=27 THEN 420
  46. 460  X2$=A$
  47. 470  IF LEN(A$)<10 THEN ST=10:GOSUB 1530:GOTO 450
  48. 480  LOCATE 25,1:PRINT SP$;:LOCATE 25,12:PRINT "Is this information correct. Yes will change the Menu ";:BEEP
  49. 490  Y$=INKEY$:IF Y$="" THEN 490
  50. 500  IF Y$="N" OR Y$="n" THEN 260
  51. 510  IF Y$="Y" OR Y$="y" THEN 520 ELSE 490
  52. 520  M$(NN)=X$:M1$(NN)=X1$:M2$(NN)=X2$
  53. 530  ' -------------------- Save new Menu data --------------------------------
  54. 540  OPEN "MENU.DAT" FOR OUTPUT AS #1
  55. 550  FOR I=1 TO 14
  56. 560  PRINT #1,M$(I):PRINT #1,M1$(I):PRINT #1,M2$(I)
  57. 570  NEXT I:CLOSE
  58. 580  '----------------------- Get question variables --------------------------
  59. 590  ON NN GOTO 600,610,620,630,640,650,660,670,680,690,700,710
  60. 600  HFIL$="ONE":GOTO 720
  61. 610  HFIL$="TWO":GOTO 720
  62. 620  HFIL$="THREE":GOTO 720
  63. 630  HFIL$="FOUR":GOTO 720
  64. 640  HFIL$="FIVE":GOTO 720
  65. 650  HFIL$="SIX":GOTO 720
  66. 660  '------ Seven is Not Used
  67. 670  HFIL$="EIGHT":GOTO 720
  68. 680  HFIL$="NINE":GOTO 720
  69. 690  HFIL$="TEN":GOTO 720
  70. 700  HFIL$="ELVEN":GOTO 720
  71. 710  HFIL$="TWELVE"
  72. 720  OPEN HFIL$+".DAT" FOR INPUT AS #2
  73. 730  INPUT #2,SUB$,PER$
  74. 740  ' ------------------- Change Question Variables ------------------------
  75. 750  CLS:QU=1:QUL=25
  76. 760  LOCATE 2,1:PRINT "Subject  ";SUB$;:A=24-LEN(SUB$):IF A>0 THEN PRINT STRING$(A,58);
  77. 770  PRINT TAB(40)"Period  ";PER$;:A=9-LEN(PER$):IF A>0 THEN PRINT STRING$(A,58);
  78. 780  LOCATE 4,1:PRINT "Question No.";TAB(60)"Questions Left":PRINT STRING$(79,196):PRINT:PRINT
  79. 790  PRINT "Year of the Event":PRINT:PRINT "Question":PRINT
  80. 800  PRINT "Type of Ans. ";:COLOR 15:PRINT "T";:COLOR 7:PRINT "/F   ";:COLOR 15:PRINT "M";:COLOR 7:PRINT "ulti Choice    ";:COLOR 15:PRINT "P";:COLOR 7:PRINT "eople Place and Things    ";:COLOR 15:PRINT "W";:COLOR 7:PRINT "ho am I"
  81. 810  PRINT:PRINT "Multi Choice (1)":PRINT TAB(14)"(2)":PRINT TAB(14)"(3)":PRINT TAB(14)"(4)"
  82. 820  PRINT:PRINT "Answer"
  83. 830  PRINT:PRINT "Ans. Remarks "
  84. 840  PRINT:PRINT STRING$(79,196):GOSUB 850:GOTO 870
  85. 850  LOCATE 25,14:COLOR 15:PRINT CHR$(24);:COLOR 7:PRINT " Prev. Line     ";:COLOR 15:PRINT CHR$(25);:COLOR 7:PRINT " Next Line     ";
  86. 860  COLOR 15:PRINT "End";:COLOR 7:PRINT " if no changes required";:RETURN
  87. 870  LOCATE 2,10:PRINT SUB$;:A=24-LEN(SUB$):IF A>0 THEN PRINT STRING$(A,58);
  88. 880  Z=0:LOCATE 2,10:LE=24:GOSUB 1390:IF Y=27 THEN 240 ELSE IF Z=79 THEN 950
  89. 890  IF LEN(A$)<10 THEN ST=10:GOSUB 1530:GOTO 870
  90. 900  SUB$=A$
  91. 910  LOCATE 2,48:PRINT PER$;:A=9-LEN(PER$):IF A>0 THEN PRINT STRING$(A,58);
  92. 920  LOCATE 2,48:LE=9:GOSUB 1390:IF Y=27 THEN 870
  93. 930  IF LEN(A$)<9 THEN ST=9:GOSUB 1530:GOTO 910
  94. 940  PER$=A$
  95. 950  OPEN "WORK" FOR OUTPUT AS #1
  96. 960  PRINT #1,SUB$:PRINT #1,PER$:CLOSE #1
  97. 970  FOR QUEST=1 TO 25
  98. 980  FOR K=1 TO 9
  99. 990  LINE INPUT #2,B$(K)
  100. 1000  NEXT K
  101. 1010  LOCATE 4,14:PRINT USING "##";QUEST:QUL=25-QUEST
  102. 1020  LOCATE 4,76:PRINT USING "##";QUL
  103. 1030  FOR J=1 TO 9:LOCATE R(J),C(J):PRINT B$(J);:A=LEN(F$(J))-LEN(B$(J)):IF A>0 THEN PRINT STRING$(A,58);
  104. 1040  NEXT J
  105. 1050  FOR I=1 TO 9
  106. 1060  Y=0:Z=0:LOCATE R(I),C(I):LE=LEN(F$(I)):GOSUB 1390:IF QUEST=1 AND I=1 AND Y=27 THEN 240
  107. 1070  IF Y=27 AND I=1 AND QUEST>1 THEN QUEST=QUEST-1:GOTO 1010
  108. 1080  IF Y=27 THEN I=I-1:GOTO 1060
  109. 1090  IF Z=79 AND I=1 THEN FOR J=1 TO 9:A$(J)=B$(J):NEXT J:GOTO 1250
  110. 1100  IF Z=72 AND I>1 THEN I=I-1:GOTO 1060
  111. 1110  IF Z=80 AND I<10 THEN A$(I)=B$(I):GOTO 1200
  112. 1120  IF Z=64 THEN 1540
  113. 1130  IF Z>0 THEN 1060
  114. 1140  A$(I)=A$:B$(I)=A$:IF I<>3 THEN 1200
  115. 1150  IF A$(3)="P" OR A$(3)="p" THEN A$(3)="1":A$(4)="0":A$(5)="0":A$(6)="0":A$(7)="0":I=7:GOTO 1200
  116. 1160  IF A$(3)="T" OR A$(3)="t" THEN A$(3)="2":A$(4)="0":A$(5)="0":A$(6)="0":A$(7)="0":I=7:GOTO 1200
  117. 1170  IF A$(3)="W" OR A$(3)="w" THEN A$(3)="3":A$(4)="0":A$(5)="0":A$(6)="0":A$(7)="0":I=7:GOTO 1200
  118. 1180  IF A$(3)="M" OR A$(3)="m" THEN A$(3)="4":GOTO 1200
  119. 1190  GOTO 1060
  120. 1200  NEXT I
  121. 1210  LOCATE 25,1:PRINT SP$;:BEEP:LOCATE 25,20:PRINT "Is this information correct ";
  122. 1220  Y$=INKEY$:IF Y$="" THEN 1220
  123. 1230  IF Y$="N" OR Y$="n" THEN 1050
  124. 1240  IF Y$="Y" OR Y$="y" THEN GOSUB 850:GOTO 1250 ELSE 1220
  125. 1250  OPEN "WORK" FOR APPEND AS #1
  126. 1260  FOR K=1 TO 9:PRINT #1,A$(K)
  127. 1270  NEXT K:CLOSE #1
  128. 1280  NEXT QUEST
  129. 1290  CLOSE:KILL HFIL$+".DAT"
  130. 1300  NAME "WORK" AS HFIL$+".DAT"
  131. 1310  LOCATE 25,1:PRINT SP$;:LOCATE 25,25:PRINT "Do you wish to do any more changes ";
  132. 1320  Y$=INKEY$:IF Y$="" THEN 1320
  133. 1330  IF Y$="Y" OR Y$="y" THEN 240
  134. 1340  IF Y$="N" OR Y$="n" THEN RUN "HISTORY" ELSE 1320
  135. 1350  ' ---------------------- Instruction Menus ----------------------------
  136. 1360  CLS:LOCATE 12,26:PRINT "The Instructions go here":LOCATE 25,1:PRINT SP$;:LOCATE 25,25:PRINT "Press Enter to Continue";:Y$=INPUT$(1):GOTO 190
  137. 1370  FOR I=17 TO 24:LOCATE I,1:PRINT SP$;:NEXT I:RETURN
  138. 1380  ' -------------------- Alpha - Numeric Input Routine ------------------
  139. 1390  A$="":LOCATE ,,1
  140. 1400  Y$=INKEY$:IF Y$="" THEN 1400
  141. 1410  IF LEN(Y$)>1 THEN Z=ASC(RIGHT$(Y$,1)):RETURN
  142. 1420  Y=ASC(Y$):IF Y=8 AND LEN(A$)>0 THEN PRINT CHR$(29);":";CHR$(29);:A$=LEFT$(A$,LEN(A$)-1):GOTO 1400
  143. 1430  IF Y=13 THEN PRINT STRING$(LE-LEN(A$),32):RETURN
  144. 1440  IF Y=27 THEN RETURN
  145. 1450  IF Y<27 THEN 1400
  146. 1460  A$=A$+Y$:PRINT Y$;
  147. 1470  IF LEN(A$)=LE THEN RETURN ELSE 1400
  148. 1480  IF ERL=720 THEN RESUME 750
  149. 1490  IF ERR=52 AND ERL=990 THEN RESUME 1010
  150. 1500  IF ERR=62 AND ERL=990 THEN RESUME 1010
  151. 1510  IF ERR=53 AND ERL=1290 THEN RESUME 1300
  152. 1520  PRINT ERR;" in line ";ERL:END
  153. 1530  LOCATE 25,1:PRINT SP$;:LOCATE 25,20:PRINT "You must have ";ST;" letters in this field ";:RETURN
  154. 1540  PRINT #1,SUB$:PRINT #2,PER$:CLOSE
  155. 1550  CLS:LOCATE 12,28:PRINT "All files saved and closed ";:CLOSE:END
  156. 1560  CLS:LOCATE 3,4:COLOR 15:PRINT "I N S T U C T I O N S    F O R    G E N E R A T I N G    Q U E S T I O N S":COLOR 7
  157. 1570  LOCATE 13,14:PRINT "Do you wish instructions to print on ";:COLOR 31:PRINT "S";:COLOR 7:PRINT "creen or ";:COLOR 31:PRINT "P";:COLOR 7:PRINT "rinter  ";
  158. 1580  Y$=INKEY$:IF Y$="" OR LEN(Y$)>1 THEN 1580
  159. 1590  IF Y$="S" OR Y$="s" THEN CON=1:PAGELEN = 18:GOTO 1650
  160. 1600  IF Y$="P" OR Y$="p" THEN CON=2:PAGELEN = 54:PRINT Y$:GOTO 1620
  161. 1610  GOTO 1580
  162. 1620  LOCATE 16,22:PRINT "Do you want to pause for paper change ";:Y$=INPUT$(1):IF Y$="Y" OR Y$="y" THEN PRI=1
  163. 1630  LOCATE 18,25:COLOR 15:PRINT "Is the Printer on and ready  (Y/N) ";
  164. 1640  Y$=INPUT$(1):IF Y$="Y" OR Y$="y" THEN 1660 ELSE 1640
  165. 1650  CLS:LOCATE 1,4:COLOR 15:PRINT "I N S T U C T I O N S    F O R    G E N E R A T I N G    Q U E S T I O N S":COLOR 7:PRINT STRING$(79,196):PRINT
  166. 1660  IF CON=2 THEN LPRINT TAB(11) "I N S T U C T I O N S    F O R    G E N E R A T I N G    Q U E S T I O N S":LPRINT STRING$(79,95):LPRINT
  167. 1670  FOR I= 1 TO PAGELEN
  168. 1680  READ A$
  169. 1690  IF A$="END" THEN 1730
  170. 1700  IF CON=1 THEN PRINT TAB(9)A$ ELSE LPRINT TAB(11)A$
  171. 1710  NEXT I:IF CON=2 THEN LPRINT CHR$(12)
  172. 1720  IF PRI=1 THEN LOCATE 25,28:PRINT "Press any key to continue ";:Y$=INPUT$(1)
  173. 1730  IF CON=1 THEN LOCATE 25,28:PRINT "Press any key to continue ";:Y$=INPUT$(1):CLS:LOCATE 1,4:COLOR 15:PRINT "I N S T U C T I O N S    F O R    G E N E R A T I N G   Q U E S T I O N S":COLOR 7:PRINT STRING$(79,196):PRINT
  174. 1740  IF CON=2 AND A$<>"END" THEN LPRINT TAB(5) "I N S T U C T I O N S    F O R    G E N E R A T I N G    Q U E S T I O N S":LPRINT TAB(4)STRING$(79,95):LPRINT
  175. 1750  IF A$="END" THEN RUN ELSE LOCATE 25,1:PRINT SP$;:LOCATE 4,1:GOTO 1670
  176. 1760  DATA "Changing the Menu"," ","    You first have  the opportunity  to change  the Menu.  The menu","displayed will be simular to the selection menu on the History part","of the program. You select the period to be changed by entering the"
  177. 1770  DATA "corresponding number."," ","    There are two rules associated with changing the menu."," ","      (1) The first letter of the subject MUST be a capital letter."," "
  178. 1780  DATA "      (2) This first letter CANNOT be the same as the first letter","          of any other subject."," ","    The reason for the above two requirements is that the selection"
  179. 1790  DATA "on the  History Menu screen,  uses this First letter to take you to","the period you wish to study. The computer will not let you violate","either of the above rules."
  180. 1800  DATA "    Having made your selection,  you may now change the Subject and","add your own brief description or explanation of that subject."," ","When the Entry is completed, you will  be asked  if the information"
  181. 1810  DATA "is correct. Please check carefully,  as your mistakes are there for","everyone to see."," ","    If you do not  want to  change the Menu  but wish to change the"
  182. 1820  DATA "questions. Pressing the End key  (#1 on the numeric pad)  will take","you to the next screen leaving the Menu unchanged."," ","    The field length is designated by a series of colon's,  one for"
  183. 1830  DATA "each character  and cannot be  exceeded.  At the end of a field the","computer will go to the next field, without you pressing Enter"," ","    After making changes  you will be asked  if the  information is"
  184. 1840  DATA "correct.  Pressing 'N'  allows you to go back and make corrections,","pressing 'Y' will save the changed Menu.","Generating or Changing Questions"," ","    There is a Minimum and Maximum of 25 questions for  each period"
  185. 1850  DATA "and once you have started,  all 25 questions must be entered before","switching the  computer off.  In other words,  you can not quite in","the middle of entering your questions."," "
  186. 1860  DATA "    You are now asked two questions 'Subject',  the subject is used","many times  in the  History  program.  Examples  'American History'","'World Space History', 'Baseball Stats'. The second question is the"
  187. 1870  DATA "Time period, Examples '1873-1983','1941-1945'. Notice NO spaces and","all the field length is used. The History program finds, it's start","and finishing dates  from this entry.  If you do not wish to change"
  188. 1880  DATA "this part press the End key and you will go into the Question phase"," ","    The first question  will now be  displayed  for you  to view or","change. If you don't wish to change that question, pressing the End"
  189. 1890  DATA "key, will save the question unchanged and display the next question","It is advisable to view one set of questions,  before attempting to","change or generate your own."," "
  190. 1900  DATA "    You should have noticed on your run through the  questions that","when the  questions are printed,  they are often followed by colons","This is to show you the remaining characters that could be added to"
  191. 1910  DATA "that line. The length of  question and  remark lines are restricted","to 78 characters.  You will many times find it hard to  stay within","this limit.  Sorry we tried hard to extend this length,  but it was"
  192. 1920  DATA "impossible  without reducing the  number of  cells in the maze.  We","did not think this was desirable."," ","    When generating or changing a question,  you are first required"
  193. 1930  DATA "to enter the year then the question (78 characters max). Next field","is the type of answer  to be used when answering, True/False, Multi", "choice, Who am I, or People places or things. Only the first letter"
  194. 1940  DATA "is required. The computer will only accept one of the valid letters","which are highlighted,  T-M-W-P.","    If you choose a  Multi choice  you are then required to fill in"
  195. 1950  DATA "the next Four fields with selections of possible answers. Any other","selected type of answer,  will automatically take you to the Answer","field. If you  selected  True/False only  T or F will be entered in"
  196. 1960  DATA "this field.  If 'Who am I' then use the Last name Only.  Lastly you","enter the remarks (78 characters maximum). This field  will only be","displayed if a wrong answer is given, when playing the game"," "
  197. 1970  DATA "    After all the  fields have  been entered,  you will be asked if","the information is correct. Pressing N will move the cursor back to","first field. The Up-Down arrows will move the cursor to the next or"
  198. 1980  DATA "previous field. If you wish to change a field, you must reenter the","entire field again. When you have finished the corrections, press Y","and you go to the  next question.  Repeating this  proceedure until"
  199. 1990  DATA "all 25 questions have been enterd."," "," "," ","    We have allowed space for Four extra Catagories if you desire","to use them.  You can put in more History questions, or maybe you"
  200. 2000  DATA "would like questions about  Sports, Science, Astronomy or another","subject of your choosing. You are limited to  11 Catagories total","(four un-used at present) and you must have  25 questions in each"
  201. 2010  DATA "catagory. This is a fun game which teaches American History while","Teleporting backwards and forwards in time.","END"
  202.